class_name IdelState

extends IState



# 进入方法
func enter() -> void:
	super.enter()
	#重置角色速度
	# characterCtr.reset_character_velocity()
	characterCtr.reset_character_x_velocity()
	pass


	

#退出方法
func exit() -> void:
	pass
	

#逻辑更新
func logic_update(_delta: float) -> void:
	#如果角色不在地面上
	if not characterCtr.character_on_ground() :
		var newState = StateMachine.CharacterStates.JUMP if characterCtr.character_cur_velocity().y < 0 else StateMachine.CharacterStates.FALL
		#切换至下落的状态
		stateMachine.switch_character_state(newState)
	

#物理更新
func physics_update(_delta: float) -> void:
	pass
	

func get_anm_name() -> String:
	return "Idel"


func get_type()-> StateMachine.CharacterStates:
	return StateMachine.CharacterStates.IDEL
